package com.zut.fitness.controller;


import com.zut.fitness.common.Result;
import com.zut.fitness.pojo.CoachClass;
import com.zut.fitness.pojo.vo.CoachClassVo;
import com.zut.fitness.service.ICoachClassService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


import java.util.List;

/**
 * 私教课程列表Controller
 * 
 * @author yuanML2018
 * @date 2025-01-04
 */
@RestController
@RequestMapping("/CoachClass")
public class CoachClassController {
    @Autowired
    private ICoachClassService coachClassService;

    /**
     * 查询私教课程列表列表
     */

    @GetMapping("/list")
    public Result<List<CoachClass>> list(CoachClass coachClass) {

        List<CoachClass> list = coachClassService.selectCoachClassList(coachClass);
        return Result.success(list);
    }


    /**
     * 获取私教课程列表详细信息
     */

    @GetMapping(value = "/{id}")
    public Result<CoachClassVo> getInfo(@PathVariable("id") Long id) {
        CoachClassVo vo = coachClassService.selectCoachClassByCoachId(id);
        return Result.success(vo);
    }
}

